package com.ruoyi.shop.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shop.mapper.ShopMapper;
import com.ruoyi.shop.domain.Shop;
import com.ruoyi.shop.service.IShopService;

/**
 * 店铺列表Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-07-31
 */
@Service
public class ShopServiceImpl implements IShopService 
{
    @Autowired
    private ShopMapper shopMapper;

    /**
     * 查询店铺列表
     * 
     * @param shopsId 店铺列表主键
     * @return 店铺列表
     */
    @Override
    public Shop selectShopByShopsId(Long shopsId)
    {
        return shopMapper.selectShopByShopsId(shopsId);
    }

    /**
     * 查询店铺列表列表
     * 
     * @param shop 店铺列表
     * @return 店铺列表
     */
    @Override
    public List<Shop> selectShopList(Shop shop)
    {
        return shopMapper.selectShopList(shop);
    }

    /**
     * 新增店铺列表
     * 
     * @param shop 店铺列表
     * @return 结果
     */
    @Override
    public int insertShop(Shop shop)
    {
        shop.setCreateTime(DateUtils.getNowDate());
        return shopMapper.insertShop(shop);
    }

    /**
     * 修改店铺列表
     * 
     * @param shop 店铺列表
     * @return 结果
     */
    @Override
    public int updateShop(Shop shop)
    {
        shop.setUpdateTime(DateUtils.getNowDate());
        return shopMapper.updateShop(shop);
    }

    /**
     * 批量删除店铺列表
     * 
     * @param shopsIds 需要删除的店铺列表主键
     * @return 结果
     */
    @Override
    public int deleteShopByShopsIds(Long[] shopsIds)
    {
        return shopMapper.deleteShopByShopsIds(shopsIds);
    }

    /**
     * 删除店铺列表信息
     * 
     * @param shopsId 店铺列表主键
     * @return 结果
     */
    @Override
    public int deleteShopByShopsId(Long shopsId)
    {
        return shopMapper.deleteShopByShopsId(shopsId);
    }

    @Override
    public Shop selectShopByShopUser(String shopUser) {
        return shopMapper.selectShopByShopUser(shopUser);
    }
}
